package com.yanyeori.framework.security.configprop;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.context.annotation.Configuration;

/**
 * Security配置属性
 *
 * @author chenkuan 2020/11/21
 */
@Getter
@Setter
@Configuration
@ConfigurationProperties(prefix = "security")
public class SecurityConfigProps {
    //匿名接口
    private String[] anonApi;
    //是否开发模式(默认false)
    private boolean devMode = false;
    //是否启用接口鉴权(默认true启用)
    private boolean enableInterfacePerAuth = true;
    //当日最大登录密码输入错误次数(默认0，不限制)
    private int dayPwdErrorTimes = 0;

    //token配置
    @NestedConfigurationProperty
    private TokenProps token = new TokenProps();

    //限流配置
    @NestedConfigurationProperty
    private LimiterProps limiter = new LimiterProps();

    //用户在线配置
    @NestedConfigurationProperty
    private OnlineProps online = new OnlineProps();
}
